package com.htfyun.factorytest.device;

import com.htfyun.factorytest.config.EinkProperty;

public enum DeviceAttr {
    jy97("jy97"),
    jyt103s("jyt103s"), //金亚太10.3 2021.02.25
    sy97("sy97"), //思源9.7 2020.12.23, //20230206, T2s remove emr and 4g
    jz97("jz97"), //九洲9.7 2020.09.18
    rf97("rf97"), //阿法迪9.7
    R9700J("R9700J"), //全勾9.7 2022.03.29
    sdk103s("sdk103s"), //PX30
    iflytek("iflytek"),
    ht10("ht10"), //汉唐公版10寸，用于测试
    iflytek10("iflytek10"), //讯飞10寸 Z1 2021.01.09 WiFi版
    iflytekT2("iflytekT2"), //讯飞10寸 T2 2021.04.27 4g版
    iflytekT2Paperless("iflytekT2Paperless"),
    iflytekT2PaperlessOffline("iflytekT2PaperlessOffline"), //无纸化 无4G 无Wifi
    iflytekEdu("iflytekEdu"),
    iflytekT2QiMing("iflytekT2QiMing"),
    iflytekT2Quantum("iflytekT2Quantum"),
    iflytekR2("iflytekR2"), //讯飞6寸 R2 2021.10.12
    jezetek("jezetek"), //九州9.7寸项目，没有HALL开关，没有HOME按键，没有电磁笔。有 SD卡和前光，前光又有冷光和暖光两种
    jezetek103("jezetek103"),//九洲10.3寸项目，没有HALL开关，没有电磁笔
    super103s("super103s"),
    super78("super78"),
    R970J("R970J"),
    iflytekT2s("iflytekT2s"),
    Aoyi60s("Aoyi60s"), //奥义6寸 无前光、喇叭、麦克风、EMR
    Pan6("Pan6"), //6寸 无麦克风、EMR, 有前光、光感
    jyt101("jyt101"), //金亚太10.1 对比T2S无4G
    dual103h("dual103h"), //双屏学生本
    dual103hv2("dual103hv2"), //双屏学生本(新wifi新4G)
    dualdz("dualdz"), //双屏学生本(新wifi新4G)
    dualtc("dualtc"), //双屏教师本
    dualsgl("dualsgl"), //双屏的单屏
    ;
    private final String customer;

    DeviceAttr(String customer) {
        this.customer = customer;
    }

    public String getCustomer() {
        return customer;
    }

    //是否有双Mic
/*    public boolean hasDoubleMic() {
        switch (this) {
            case jz97:
            case jezetek:
            case jezetek103:
            case sy97:
            case jyt103s:
                return false;
            case iflytek:
            case sdk103s:
            case ht10:
            case iflytek10:
            default:
                return true;
        }
    }*/

    //是否有VolumeKey
/*    public boolean hasVolumeKey() {
        switch (this) {
            case jz97:
            case jezetek:
            case jezetek103:
            case sy97:
                return false;
            case iflytek:
            case sdk103s:
            default:
                return true;
        }
    }*/

    //是否有HallKey
/*    public boolean hasHallKey() {
        switch (this) {
            case jz97:
            case jezetek:
            case jezetek103:
            case sy97:
            case sdk103s:
                return false;
            case iflytek:
            default:
                return true;
        }
    }*/

    //是否有HomeKey
/*    public boolean hasHomeKey() {
        switch (this) {
            case jz97:
            case jezetek:
            case sy97:
                return false;
            case jezetek103:
            case iflytek:
            case sdk103s:
            default:
                return true;
        }
    }*/

    //是否有backKey
/*    public boolean hasBackKey() {
        switch (this) {
            case jezetek103:
                return true;
            case jz97:
            case jezetek:
            case iflytek:
            case sdk103s:
            case sy97:
            default:
                return false;
        }
    }*/

    //是否有触摸屏
    public boolean isExistTP() {
        switch (this) {

            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualtc:
                return false;

            default:
            case dualsgl:
                return true;

        }
    }

    //是否有电磁笔
    public boolean isExistETP() {
        switch (this) {

            case jezetek:
            case jezetek103:
            case sy97:
            case iflytekR2:
            case Aoyi60s:
            case Pan6:
                return false;

            case iflytek:
            case iflytek10:
            case ht10:
            case sdk103s:
            case jyt103s:
            case jz97:
            case jy97:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekT2PaperlessOffline:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case rf97:
            case super103s:
            case super78:
            case R970J:
            case iflytekT2s:
            case jyt101:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            default:
                return true;

        }
    }

    public boolean hasLightSensor() {
        switch (this) {
            case Pan6:
                return true;

            default:
                return false;
        }
    }

    //是否有前灯
    public boolean hasForeLight() {
        switch (this) {

            case jezetek:
            case iflytekR2:
            case Pan6:
                return true;

            case jezetek103:
            case iflytek:
            case iflytek10:
            case ht10:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekT2PaperlessOffline:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case sdk103s:
            case jyt103s:
            case jz97:
            case sy97:
            case jy97:
            case rf97:
            case super103s:
            case super78:
            case R970J:
            case iflytekT2s:
            case jyt101:
            case Aoyi60s:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            default:
                return false;

        }
    }

    //是否测试电流
    public boolean hasElectricCurrent() {
        switch (this) {
//            case iflytekR2:
//                return true;
            default:
                return false;
        }
    }

    //是否有SimCard
/*    public boolean hasSIMCard() {
        switch (this) {
            case ht10:
            case iflytekT2:
                return true;

            case jyt103s:
            case sdk103s:
            case iflytek:
            case iflytek10:
            case jezetek:
            case jezetek103:
            case jz97:
            case sy97:
            case jy97:
            default:
                return false;

        }
    }*/

    //是否有Sdcard
    public boolean hasSDCard() {
        switch (this) {

            case jezetek:
            case ht10:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekT2PaperlessOffline:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case iflytek10:
            case R970J:
            case iflytekT2s:
            case jyt101:
            case sy97:
                return true;

            case sdk103s:
            case jezetek103:
            case iflytek:
            case jz97:
                //case sy97:
            case jyt103s:
            case jy97:
            case rf97:
            case super103s:
            case super78:
            case iflytekR2:
            case Aoyi60s:
            case Pan6:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualtc:
            case dualsgl:
            default:
                return false;

        }
    }

    //是否有蓝牙
    public boolean hasBluetooth() {
        switch (this) {
            case dual103hv2:
            case dualdz:
                return false;
            default:
                return true;
        }
    }

    //是否有蓝牙录音
    public boolean hasBluetoothRecord() {
        switch (this) {

            case iflytek:
            case iflytek10:
            case ht10:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case iflytekT2PaperlessOffline:
                return true;

            case jezetek103:
            case jezetek:
            case jz97:
            case sy97:
            case sdk103s:
            case jyt103s:
            case jy97:
            case rf97:
            case super103s:
            case super78:
            case iflytekR2:
            case R970J:
            case iflytekT2s:
            case jyt101:
            case Aoyi60s:
            case Pan6:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            default:
                return false;

        }
    }

    //是否有指纹
    public boolean hasFingerprint() {
        switch (this) {

//            case jezetek:
//            case jyt103s:
//                return true;

            case sdk103s:
            case jezetek103:
            case iflytek:
            case iflytek10:
            case ht10:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case jz97:
            case sy97:
            case jy97:
            case rf97:
            case super103s:
            case super78:
            case iflytekR2:
            case R970J:
            case iflytekT2s:
            case jyt101:
            case Aoyi60s:
            case Pan6:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            default:
                return false;

        }
    }

    //是否有摄像头
    public boolean hasCamera() {
        switch (this) {

            case jezetek:
            case jyt103s:
                return true;
            case jezetek103:
            case iflytek:
            case iflytek10:
            case ht10:
            case iflytekT2:
            case iflytekT2Paperless:
            case iflytekT2PaperlessOffline:
            case iflytekEdu:
            case iflytekT2QiMing:
            case iflytekT2Quantum:
            case jz97:
            case sy97:
            case sdk103s:
            case jy97:
            case rf97:
            case super103s:
            case super78:
            case iflytekR2:
            case R970J:
            case iflytekT2s:
            case Aoyi60s:
            case Pan6:
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            default:
                return false;

        }
    }

    public boolean hasOtg() {
        switch (this) {
            case super78:
            case super103s:
                return true;

            default:
                return false;

        }
    }

    public boolean hasVersionInfo() {
        switch (this) {
            case super78:
            case super103s:
                return true;

            default:
                return false;

        }
    }

    public boolean hasPenAccuracy() {
        switch (this) {
            case super78:
            case super103s:
                return true;

            default:
                return false;

        }
    }

    public boolean hasHeadSet() {
        switch (this) {
            case super78:
            case super103s:
//            case R970J:
//            case iflytekT2s:
                return false;

            case Pan6:
            default:
                return true;

        }
    }

    public boolean hasMicrophone() {
        switch (this) {
            case super78:
            case super103s:
            case Aoyi60s:
            case Pan6:
                return false;

            default:
                return true;

        }
    }

    public boolean hasWiFi() {
        switch (this) {
            case iflytekT2PaperlessOffline:
                return false;

            default:
                return true;
        }
    }

    public boolean hasSpeaker() {
        switch (this) {
            case Aoyi60s:
            case super103s:
            case super78:
                return false;

            case Pan6:
            default:
                return true;
        }
    }

    public boolean hasLed() {
        switch (this) {
            case dual103h:
            case dual103hv2:
            case dualdz:
            case dualsgl:
            case dualtc:
                return false;

            default:
                return true;
        }
    }

    public boolean hasRGBLed() {
        switch (this) {
            case super103s:
            case super78:
                return true;

            case Aoyi60s:
            case Pan6:
            default:
                return false;
        }
    }

    public boolean hasBatteryTemperatureCheck() {
        switch (this) {
            case jyt103s:
            case iflytekR2:
            case iflytekT2:
                return false;

            case iflytekT2s:
            case jyt101:
            default:
                return true;
        }
    }

    public boolean hasMotherboardTemperatureCheck() {
        switch (this) {
            case jyt103s:
                return false;

            case iflytekR2:
            case Pan6:
            default:
                return true;
        }
    }

    public static DeviceAttr getRunningDeviceAttr() {
        DeviceAttr attr = iflytekT2;
        final String customer = EinkProperty.getDeviceCustomer();
        for (DeviceAttr deviceAttr : DeviceAttr.values()) {
            if (deviceAttr.getCustomer().equalsIgnoreCase(customer)) {
                attr = deviceAttr;
                break;
            }
        }
        return attr;
    }
}
